<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page import="org.apache.struts2.ServletActionContext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>Docs2SWF Demo</title>
	<link rel="stylesheet" href="css/styles.css" type="text/css" />
    <script src="js/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="js/flexpaper/flexpaper_flash.js" type="text/javascript"></script>
    <script type="text/javascript">
	   $(function () {
	
	       $('.swf').click(function () {
	           var fp = new FlexPaperViewer(
				'js/flexpaper/FlexPaperViewer',
				'viewerPlaceHolder', { config: {
					SwfFile: escape($(this).attr('rel')),
					Scale: 0.95,
					ZoomTransition: 'easeOut',
					ZoomTime: 0.5,
					ZoomInterval: 0.2,
					FitPageOnLoad: false,
					FitWidthOnLoad: false,
					FullScreenAsMaxWindow: false,
					ProgressiveLoading: false,
					MinZoomSize: 0.2,
					MaxZoomSize: 5,
					SearchMatchAll: false,
					InitViewMode: 'Portrait',
					PrintPaperAsBitmap: false,
	
					ViewModeToolsVisible: true,
					ZoomToolsVisible: true,
					NavToolsVisible: true,
					CursorToolsVisible: true,
					SearchToolsVisible: true,
	
					localeChain: 'en_US'
				}
				});
	
	       });
	       $('.swf:first').click();
	   });
    </script> 
</head>
<body>
	<div class="wrapper">
        <a id="viewerPlaceHolder" class="doc"></a>
        <div class="list">
            <div class="upload">
                <s:form action="DemoAction" method="post" enctype="multipart/form-data">
				    <s:file name="doc" label="File"/>  
				    <s:token />
			      	<s:submit/>
				</s:form>
				<s:if test="#request.finish == 'finished!'">
					<s:property value="#request.finish"/>
			      	<s:url id="demo" value="/Demo.jsp" />
			      	<s:a href="%{demo}">刷新</s:a>
				</s:if>
            </div>
            <ol>
			<s:bean name="com.docs2swf.model.SWFileBean" id="files">
				<s:iterator value="%{#files.getList()}" status="file">                
			        <li><a rel="output/<s:property value='%{filename}'/>" class="swf"><s:property value='%{filename}'/></a></li>
			    </s:iterator>
			</s:bean>
		    </ol>
        </div>
    </div>
	
</body>
</html>